<template>
	<view>
		<view class="time">
			<view class="uni-form-item uni-column">
				<input class="uni-input" focus v-model="khzh" placeholder="请输入客户手机号" />
			</view>
		</view>
		<view class="uni-padding-wrap uni-common-mt">
			<button type="primary" @click="query">查询</button>
		</view>
		<view class="uni-form-item uni-column uni-center" v-if="!FormData">
			<view class="title">没有信息</view>
		</view>
		<view class="box" v-for="(item, index) in FormData" :key="index">
			<view class="name">客户名称: {{item.name}}</view>
			<!-- <view class="shuangb"><text>积分: {{item.jf}}</text></view> -->
			<view class="name color">手机号: {{item.account}}</view>
			<view class="cent"><text class="bdfw" @click="draw(item)">填写存款信息</text></view>
		</view>
	</view>
</template>

<script>
	import DyDate from '@/components/dy-Date/dy-Date.vue'
	export default {
		components: {
			DyDate
		},
		data() {
			return {
				khzh: '',
				title: "请选择时间",
				FormData: [],
			}
		},
		mounted() {
			let params = {
				page: 1,
				limit: 10,
			};
			// this.init(params);
		},
		methods: {
			init(params) {
				params.ty = 1
			},
			query() {
				let params = {
					page: 1,
					limit: 9999999,
					account: this.khzh
				}
				this.$api.getJf(params).then((res) => {
					if (res.rows.length == 0) {
						this.FormData = ''
						return
					}
					this.FormData = res.rows
					console.log(res)
				}).catch((err) => {
					console.log('request fail', err);
				})
			},
			draw(item) {
				uni.navigateTo({
					url: '../depositInfo/depositInfo?id=' + item.aid + '&name=' + item.name
				});
			}
		}
	}
</script>

<style scoped>
	.box {
		background: #F8F8FF;
		margin: 10px;
		border-radius: 10px;
		padding: 10px;
		line-height: 24px;
	}

	.name {
		font-weight: bold;
		font-size: 16px;
	}

	.color {
		color: red;
	}

	.shuangb {
		display: flex;
		justify-content: space-between;
	}

	.cent {
		display: flex;
		justify-content: center;
	}

	.bdfw {
		background: #007AFF;
		display: block;
		width: 100px;
		text-align: center;
		border-radius: 10px;
		color: #fff;
	}

	.time {
		display: flex;
	}

	.dateTime {
		height: 24px;
		padding: 7px 12px;
		line-height: 24px;
	}
</style>
